<style>
	table tr td {
		text-align:center;
	}
</style>
<form class="form-search" action="" method="post" onsubmit="reload();return false;">
<table class="table table-bordered">
	<tbody><tr style="background:#F5F5F5"><td><span>快速搜索:</span></td>
		<td>发送时间:
			<div id="datetimepicker-start" class="input-append date">
			  <input type="text" disabled onchange="datepickerRange(value,'datetimepicker-end')" name="startdate"></input>
			  <span class="add-on">
				<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
			  </span>
			</div>
			至
			<div id="datetimepicker-end" class="input-append date">
			  <input type="text" disabled class="datetimepicker-end" name="enddate"></input>
			  <span class="add-on">
				<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
			  </span>
			</div>
		</td><td>手机号:</td><td><input type="text"/></td><td><input type="submit" class="btn" value="搜索"/></td></tr></tbody>
</table>
</form>
<table class="table table-bordered table-hover">
	<thead><tr><td><input type="checkbox"/></td><td>记录编号</td><td>短信条数</td><td>手机号</td><td>状态</td><td>创建时间</td><td>发送时间</td><td width="300">短信内容</td><td>操作</td></tr></thead>
	<tbody>
		<volist name="list" id="vo">
		<tr><td><input type="checkbox"/></td><td>{$vo.inbox_id}</td><td>{$vo.mobile_amount}</td><td>{$vo.mobiles}</td><td><switch name="vo.audit"><case value="1"><span class="label label-success">审核通过</span></case><case value="-1"><span class="label label-important">审核未过</span></case><case value="0"><span class="label label-info">未审核</span></case><default /><span class="label label-warning">参数出错</span></switch></td><td>{$vo.create_time}</td><td>{$vo.send_time}</td><td>{$vo.sms_content}</td><td width=120>
		<span class="label label-info" style="cursor:pointer" onclick="viewDetail({$vo.inbox_id})">查看</span>
		<span class="label label-important" style="cursor:pointer;margin-left:5px">删除</span>
		<span class="label label-success" style="cursor:pointer;margin-left:5px" onclick="exportPhone({$vo.inbox_id})">导出</span></td></tr>
		</volist>
	</tbody>
</table>
<div class="pagination" style="float:right">
	{$page}
</div>
<script>
	$(function(){
		$("#datetimepicker-start").datetimepicker({format:"yyyy-MM-dd"});
		$("#datetimepicker-end").datetimepicker({format:"yyyy-MM-dd"});
	});
	function exportPhone($inboxID){
		//alert($inboxID);
		var form=$("<form>");//定义一个form表单
		form.attr("style","display:none");
		form.attr("target","");
		form.attr("method","post");
		form.attr("action","__APP__/SMS/exportPhoneTxt");
		var input1=$("<input>");
		input1.attr("type","hidden");
		input1.attr("name",'inbox_id');
		input1.attr("value",$inboxID);
		$("body").append(form);//将表单放置在web中
		form.append(input1);
		form.submit();//表单提交 
		/*$.get('__APP__/SMS/exportPhoneTxt',{inbox_id:$inboxID},function(json){
			if(json.status == 1){
				alert(json.info);
			}else{
				alert(json.info);
			}
		});
		*/
	}
	function reload(){
		$("#maincontent").load('__APP__/SMS/noSend',{startdate:getInputValueByName('startdate'),enddate:getInputValueByName('enddate'),account:getInputValueByName('account')});
	}
	function viewDetail($inbox_id){
		$.dialog("短信详情","__APP__/SMS/smsDetail/inbox_id/"+$inbox_id);
	}
</script>